---
layout: common
title: 日期归档
description: 按时间对文章分类
keywords: java,Linux,php,jekyll
isArchive: true
---
<article class="main-article main-article-page">
    <div class="ztheme-title">
        <h3 class="ztheme-title-item">
            日期归档
            <span>(共{{ site.posts | size }}篇)</span>
        </h3>
    </div>
    <div class="ztheme-post">
        <div class="main-article-contant">
            {% capture post_year1 %}{{ date: '%Y' }}{% endcapture %}
            <h3>{{ post_year1 }}</h3>
            <ul class="article-year fn-clear">{% for post in site.posts %} {% capture post_year2 %}{{ post.date | date:
                '%Y' }}{% endcapture %} {% if post_year1 != post_year2 %} {% assign post_year1 = post_year2 %}
            </ul>
            <h3>{{ post_year1 }}</h3>
            <ul class="article-year fn-clear">
                {% endif %}
                <li>
                    <a href="{{ post.url }}">
                        <div class="post_date">{{ post.date | date_to_utc | date: '%Y-%m-%d' }}</div>
                        <div class="post_title">{{ post.title }}</div>
                        <div class="post_keywords">
                            {% for keyword in post.keywords %}
                            {{ keyword }}
                            {% endfor %}
                        </div>
                    </a>
                </li>
                {% endfor %}
            </ul>
            <!-- 随机色块 -->
            <script type="text/javascript" src="{{ site.themes }}/js/randomColor.js"></script>
            <script type="text/javascript">
                $(document).ready(function () {
                    randomColor();
                });
            </script>
        </div>
    </div>
</article>
